<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>::Registro de Cliente::</title>


<link rel="stylesheet" type="text/css" media="screen" href="/dew_karaoke/resources/css/jquery/ui-lightness/jquery-ui-1.8.6.custom.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="/dew_karaoke/resources/css/jqgrid/ui.jqgrid.css" />

	<script type="text/javascript" src='<s:url value="/resources/js/jquery/jquery-1.4.4.min.js" ></s:url>'></script>
	<script type="text/javascript">
	    var jq = jQuery.noConflict();
	</script>
	<script type="text/javascript" src='<s:url value="/resources/js/jquery/jquery-ui-1.8.6.custom.min.js" ></s:url>'></script>
	<script type="text/javascript" src='<s:url value="/resources/js/jqgrid/grid.locale-en.js" ></s:url>'></script>
	<script type="text/javascript" src='<s:url value="/resources/js/jqgrid/jquery.jqGrid.min.js" ></s:url>'></script>
	
</head>
<body>



<script type="text/javascript">

function addRow() {

	// Get the currently selected row
    jq("#grid").jqGrid('editGridRow','new',
    		{ 	url: '<s:url value="/karaoke/registro/add"></s:url>', 
					editData: {
			    },
			    recreateForm: true,
			    beforeShowForm: function(form) {
			    },
			   
			    
				closeAfterAdd: true,
				reloadAfterSubmit:true,
				afterSubmit : function(response, postdata) 
				{ 
			        var result = eval('(' + response.responseText + ')');
					var errors = "";
					
			        if (result.success == false) {
						for (var i = 0; i < result.message.length; i++) {
							errors +=  result.message[i] + "<br/>";
						}
			        }  else {
			        	jq("#dialog").text('Entry has been added successfully');
						jq("#dialog").dialog( 
								{	title: 'Success',
									modal: true,
									buttons: {"Ok": function()  {
										jq(this).dialog("close");} 
									}
								});
	                }
			    	// only used for adding new records
			    	var new_id = null;
			    	
					return [result.success, errors, new_id];
				}
    		});

}



</script> 

<div id="jqgrid" style="width: 640px; margin-left: auto; margin-right: auto;">
	<table id="grid"></table>
	<div id="pager"></div>
</div>

<div id="dialog" title="Feature not supported" style="display:none">
	<p>That feature is not supported.</p>
</div>

<div id="dialogSelectRow" title="Warning" style="display:none">
	<p>Please select row</p>
</div>



</body>
</html>